package com.ies.dx.dex.file;

import com.ies.dx.util.ByteArrayLittleEdianInput;
import com.ies.dx.util.Hex;
import com.ies.dx.util.Input;

public class string_id_item extends dex_item
{
    private int string_data_off; //uint
    private string_data_item data;

    public string_id_item(dex_file file)
    {
        super(file);
        data = new string_data_item(file);
    }
    
    public void readData(Input dis)
    {
        try
        {
            dis.moveCursorTo(string_data_off);
            data.read(dis);
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    
    public void read(Input dis)
    {
        try
        {
            string_data_off = dis.readInt();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    public void show()
    {
        System.out.println("[string]            : " + string_data_off + " (0x" + Hex.u4(string_data_off) + ")");
//        data.show();        
    }

    public String getData() 
    {
        return data.getData();
    }
}
